//
//  loginView.m
//  ChunLaiZhuangClient
//
//  Created by zzs on 16/2/25.
//  Copyright © 2016年 CLZ. All rights reserved.
//

#import "loginView.h"
#import "ApiClient+Ext.h"
#import "ResetPassordViewController.h"
@interface loginView()

@property(nonatomic, copy) NSString *mobileNumber;
@property(nonatomic, copy) NSString *password;
- (IBAction)isSecurityAction:(id)sender;

@end

@implementation loginView
-(void)awakeFromNib{
    self.bgView1.layer.cornerRadius=5;
    self.bgView2.layer.cornerRadius=5;
    self.loginBt.layer.cornerRadius=5;
    self.loginBt.clipsToBounds=YES;
    [self.mobileTF setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
    [self.passwordTF setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (IBAction)loginAction:(id)sender {
    self.mobileNumber = self.mobileTF.text;
    self.password = self.passwordTF.text;
    if (self.LoginBlock) {
        self.LoginBlock(self.mobileNumber, self.password);
    }
}

- (IBAction)forgetAction:(id)sender {
    //重置密码
    ResetPassordViewController *resetVC=[[ResetPassordViewController alloc] init];
    UIViewController *currentVC=[loginView viewController:self];
    UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:resetVC];
    [currentVC presentViewController:nav animated:YES completion:^{
        
    }];
    

}
- (IBAction)isSecurityAction:(id)sender {
    UIButton *bt=(UIButton*)sender;
    bt.selected=!bt.selected;
    self.passwordTF.secureTextEntry=bt.selected;
}
@end
